﻿using Farming.Application;
using Farming.Domain;
using Farming.Domain.DTO;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace Farming.WebApi.Controllers
{/// <summary>
/// api控制器
/// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    public class FarmingManagementController : ControllerBase
    {
        private readonly TestService testService;
        private readonly AccountService accountService;

        public FarmingManagementController(TestService testService, AccountService accountService)
        {
            this.testService = testService;
            this.accountService = accountService;
        }
        /// <summary>
        /// 软删除
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        
        [HttpGet]
        public IActionResult DelTest01(int Id)
        {
            return Ok(testService.DelTest01(Id));
        }
        /// <summary>
        /// 显示列表
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public async Task<IActionResult> GetSoftDeleteEntityListAsync()
        {
            var list = await testService.GetSoftDeleteEntityListAsync();
            return Ok(list);
        }
        [HttpPost]
        public async Task<IActionResult> GetLoginAsync(LoginRequest request)
        {
            var list = await accountService.GetLoginAsync(request);
            return Ok(list);
        }
    }
}
